<%#
  # WebROaR - Ruby Application Server - http://webroar.in/
  # Copyright (C) 2009  Goonj LLC
  #
  # This file is part of WebROaR.
  #
  # WebROaR is free software: you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation, either version 3 of the License, or
  # (at your option) any later version.
  #
  # WebROaR is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  # GNU General Public License for more details.
  #
  # You should have received a copy of the GNU General Public License
  # along with WebROaR.  If not, see <http://www.gnu.org/licenses/>.
  #%>

  <div class='text_align_right'><%=link_to_remote 'Back', :url => {:controller => 'exceptions', :action => 'list_statuswise_exceptions', :app_name => app_name, :status_name => status_name, :page => page }%></div>
  <table width = 90% align='center'>
    <tr>
      <th colspan = 2 >Exception Information</th>
    </tr>
    <tr>
      <td class="sub_header" width = 20%>Exception Message</td>
      <td><%= @exception.exception_message%></td>
    </tr>
    <tr>
      <td class="sub_header">Class </td>
      <td><%= @exception.exception_class%></td>
    </tr>
    <tr>
      <td class="sub_header">URL </td>
      <td><%= @exception.controller%>/<%=h @exception.method%></td>
    </tr>
    <tr>
      <td class="sub_header">Occurrences </td>
      <td><%= @exception.exceptions_count%></td>
    </tr>
    <% i = 0 %>
    <%@exception.occurrences.each do |occurrence|%>
    <tr>
      <td class="sub_header">&nbsp;</td>
      <td>
        <%=  occurrence.wall_time.strftime("%d-%b-%Y %H:%M:%S") %>&nbsp;&nbsp;
        <%= link_to_remote raw("<span class='link_button'>Backtrace</span>"),:update => 'data_div', :url => { :controller =>"exceptions",:action =>'show_exception_backtrace',:id => @exception.id,:index => i,:app_name => app_name, :status_name => status_name, :page => page}%>&nbsp;&nbsp;
        <%= link_to_remote raw("<span class='link_button'>Environment</span>"),:update => 'data_div',:url => { :controller =>"exceptions",:action =>'show_exception_environment',:id => @exception.id,:index => i,:app_name => app_name, :status_name => status_name, :page => page}%>
      </td>
      <% i+=1 %>
    </tr>
    <%end%>
    <tr><th>&nbsp;</th></tr>
  </table>